package com.hhkj.study.admin.article.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hhkj.study.admin.article.enums.BannerEnum;
import com.ruoyi.common.core.domain.BizBaseEntity;
import com.ruoyi.common.valid.VAdd;
import com.ruoyi.common.valid.VDisable;
import com.ruoyi.common.valid.VEdit;
import com.ruoyi.common.valid.emun.EnumValueCheck;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
*
* @author SERVER
* @since 2024-09-06
*/
@TableName(value = "x_article_banner")
@EqualsAndHashCode(callSuper = true)
@Data
public class ArticleBanner extends BizBaseEntity {

	/**
	 * 所属类别，courseIndexCode首页,courseCenterCode课程中心
	*/
	@NotBlank(message = "所属类别不能为空", groups = VAdd.class)
	@EnumValueCheck(message = "所属类别有误", target = BannerEnum.class, groups = {VAdd.class, VEdit.class})
	private String catalogCode;
	/**
	 * 标题
	*/
	@NotBlank(message = "标题不能为空", groups = VAdd.class)
	private String title;
	/**
	 * 课程大类,字典表中id
	*/
	private String courseTypes;
	/**
	 * 所在区域,关联x_dict_multi_level表id
	*/
	private String provinceIds;
	/**
	 * 上架标记（0-下架， 1-上架）
	*/
	@NotNull(message = "上架标记不能为空", groups = {VAdd.class, VDisable.class})
	private Integer publishedFlag;
	/**
	 * 轮播排序序号
	*/
	private Integer orderNum;
	/**
	 * 图片url
	*/
	@NotBlank(message = "图片url不能为空", groups = VAdd.class)
	private String imageUrl;
	/**
	 * 链接内容url
	*/
	@NotBlank(message = "关联url不能为空", groups = VAdd.class)
	private String linkUrl;

	@NotEmpty(message = "课程类型不能为空", groups = VAdd.class)
	@TableField(exist = false)
	private List<Long> courseTypeList;

	@NotEmpty(message = "所属区域不能为空", groups = VAdd.class)
	@TableField(exist = false)
	private List<Long> provinceIdList;
}